import Vue from 'vue'
import VueRouter from 'vue-router'
import login from '@/views/Login'
import register from '@/views/Register/index'
import admin from '@/views/Admin/index'
import student from '@/views/Student/index'
import teacher from '@/views/Teacher/index'
import pubinfo from '@/views/Admin/Content/Pubinfo/index'
import acccheck from '@/views/Admin/Content/Accountcheck/index'
import coursecheck from '@/views/Admin/Content/Coursecheck/index'
import pubmanage from '@/views/Admin/Content/Pubmanage/index'
import course from '@/views/Admin/Content/Course/index'
import stuacc from '@/views/Admin/Content/Stuacc/index'
import tchaccedit from '@/views/Teacher/Content/Accedit/index'
import stuaccedit from '@/views/Student/Content/Accedit/index'
import courseinfo from '@/views/Teacher/Content/Courseinfo/index'
import teachercourse from '@/views/Teacher/Content/Courseinfo/Teachercourse/index'
import coursecreate from '@/views/Teacher/Content/Courseinfo/Coursecreate/index'
import hwinfo from '@/views/Teacher/Content/Homeworkinfo/index'
import coursehw from '@/views/Teacher/Content/Homeworkinfo/Coursehw/index'
import concrete from '@/views/Teacher/Content/Homeworkinfo/Hwinfo/index'
import hwcreate from '@/views/Teacher/Content/Homeworkinfo/Hwcreate/index'
import courseselect from '@/views/Student/Content/Courseselect/index'
import hwsubmit from '@/views/Student/Content/Hwsubmit/index'
import hwget from '@/views/Student/Content/Hwsubmit/Hwget/index'
import studenthw from '@/views/Student/Content/Hwsubmit/Studenthw/index'
Vue.use(VueRouter)

const router=new VueRouter({
    routes:[
        {path:'/',redirect:'/login'},
        {path:'/login',component:login},
        {path: '/register',component:register},
        {path: '/admin',component:admin,children:[
            {path:'pubinfo',component:pubinfo},
            {path:'acccheck',component:acccheck},
            {path:'coursecheck',component:coursecheck},
            {path:'pubmanage',component:pubmanage},
            {path:'course',component: course},
            {path: 'stuacc',component: stuacc}
        ],redirect: '/admin/pubinfo'},
        {path: '/student',component:student,children:[
            {path:'pubinfo',component:pubinfo},
            {path:'accedit',component:stuaccedit},
            {path:'courseselect',component:courseselect},
            {path:'hwsubmit',component:hwsubmit,children:[
                {path:'hwget/:courseid/:hwid',component:hwget,name:'hwget'},
                {path:'studenthw',component:studenthw}
            ],redirect: 'hwsubmit/studenthw'},
        ],redirect: 'student/pubinfo'},
        {path: '/teacher',component: teacher,children:[
            {path:'pubinfo',component:pubinfo},
            {path:'accedit',component:tchaccedit},
            {path:'courseinfo',component:courseinfo,children:[
                {path:"teachercourse",component:teachercourse},
                {path:"coursecreate",component:coursecreate}
            ],redirect:"courseinfo/teachercourse"},
            {path:'hwinfo',component:hwinfo,children:[
                {path:'coursehw',component:coursehw},
                {path:'concrete/:courseid/:hwid',name:'concrete',component:concrete},
                {path:'hwcreate',component:hwcreate},
            ],redirect: 'hwinfo/coursehw'},
        ],redirect:'/teacher/pubinfo'}
    ],
    mode:"hash"
})

export default router;